package com.slz3.business.module.orderManagement.ordOrderLine.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.orderManagement.ordOrderLine.domain.OrdOrderLine;
import com.slz3.business.module.orderManagement.ordOrderLine.domain.OrdOrderLineCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class OrdOrderLineResAtomic {

    static Mono<ServerResponse> add_$OrdOrderLineUpdateLock(ServerRequest req, OrdOrderLine ordOrderLine) {
        return OrdOrderLineResSafeValid.add(req, ordOrderLine) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdOrderLineResExecutor.add(req, ordOrderLine);
    }

    public static Mono<ServerResponse> delete_$OrdOrderLineUpdateLock(ServerRequest req, OrdOrderLineCondition ordOrderLineCondition) {
        return OrdOrderLineResSafeValid.delete(req, ordOrderLineCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdOrderLineResExecutor.delete(req);
    }

    static Mono<ServerResponse> modify_$OrdOrderLineUpdateLock(ServerRequest req, OrdOrderLine ordOrderLine) {
        return OrdOrderLineResSafeValid.modify(req, ordOrderLine) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdOrderLineResExecutor.modify(req, ordOrderLine);
    }

    static Mono<ServerResponse> info_$OrdOrderLineUpdateLock(ServerRequest req) {
        return OrdOrderLineResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdOrderLineResExecutor.info(req);
    }

    public static Mono<ServerResponse> auditSubmit_$OrdOrderLineUpdateLock(ServerRequest req, OrdOrderLineCondition ordOrderLineCondition) {
        return OrdOrderLineResSafeValid.auditSubmit(req, ordOrderLineCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdOrderLineResExecutor.auditSubmit(req);
    }

    public static Mono<ServerResponse> audit_$OrdOrderLineUpdateLock(ServerRequest req, OrdOrderLineCondition ordOrderLineCondition) {
        return OrdOrderLineResSafeValid.audit(req, ordOrderLineCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdOrderLineResExecutor.audit(req);
    }

    public static Mono<ServerResponse> auditReject_$OrdOrderLineUpdateLock(ServerRequest req, OrdOrderLineCondition ordOrderLineCondition) {
        return OrdOrderLineResSafeValid.auditReject(req, ordOrderLineCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdOrderLineResExecutor.auditReject(req);
    }


    public static Mono<ServerResponse> usingEnable_$OrdOrderLineUpdateLock(ServerRequest req, OrdOrderLineCondition ordOrderLineCondition) {
        return OrdOrderLineResSafeValid.usingEnable(req, ordOrderLineCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdOrderLineResExecutor.usingEnable(req);
    }

    public static Mono<ServerResponse> usingDisable_$OrdOrderLineUpdateLock(ServerRequest req, OrdOrderLineCondition ordOrderLineCondition) {
        return OrdOrderLineResSafeValid.usingDisable(req, ordOrderLineCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdOrderLineResExecutor.usingDisable(req);
    }
}
